{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd \n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pregnancies  Glucose  BloodPressure  SkinThickness  Insulin   BMI  \\\n",
       "0            6      148             72             35        0  33.6   \n",
       "1            1       85             66             29        0  26.6   \n",
       "2            8      183             64              0        0  23.3   \n",
       "3            1       89             66             23       94  28.1   \n",
       "4            0      137             40             35      168  43.1   \n",
       "\n",
       "   DiabetesPedigreeFunction  Age  Outcome  \n",
       "0                     0.627   50        1  \n",
       "1                     0.351   31        0  \n",
       "2                     0.672   32        1  \n",
       "3                     0.167   21        0  \n",
       "4                     2.288   33        1  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取数据\n",
    "dpath = './'\n",
    "train = pd.read_csv(dpath +\"diabetes.csv\")\n",
    "train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 768 entries, 0 to 767\n",
      "Data columns (total 9 columns):\n",
      "Pregnancies                 768 non-null int64\n",
      "Glucose                     768 non-null int64\n",
      "BloodPressure               768 non-null int64\n",
      "SkinThickness               768 non-null int64\n",
      "Insulin                     768 non-null int64\n",
      "BMI                         768 non-null float64\n",
      "DiabetesPedigreeFunction    768 non-null float64\n",
      "Age                         768 non-null int64\n",
      "Outcome                     768 non-null int64\n",
      "dtypes: float64(2), int64(7)\n",
      "memory usage: 54.1 KB\n"
     ]
    }
   ],
   "source": [
    "train.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>3.845052</td>\n",
       "      <td>120.894531</td>\n",
       "      <td>69.105469</td>\n",
       "      <td>20.536458</td>\n",
       "      <td>79.799479</td>\n",
       "      <td>31.992578</td>\n",
       "      <td>0.471876</td>\n",
       "      <td>33.240885</td>\n",
       "      <td>0.348958</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.369578</td>\n",
       "      <td>31.972618</td>\n",
       "      <td>19.355807</td>\n",
       "      <td>15.952218</td>\n",
       "      <td>115.244002</td>\n",
       "      <td>7.884160</td>\n",
       "      <td>0.331329</td>\n",
       "      <td>11.760232</td>\n",
       "      <td>0.476951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078000</td>\n",
       "      <td>21.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>27.300000</td>\n",
       "      <td>0.243750</td>\n",
       "      <td>24.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>117.000000</td>\n",
       "      <td>72.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>30.500000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>0.372500</td>\n",
       "      <td>29.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>140.250000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>127.250000</td>\n",
       "      <td>36.600000</td>\n",
       "      <td>0.626250</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.000000</td>\n",
       "      <td>199.000000</td>\n",
       "      <td>122.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>846.000000</td>\n",
       "      <td>67.100000</td>\n",
       "      <td>2.420000</td>\n",
       "      <td>81.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Pregnancies     Glucose  BloodPressure  SkinThickness     Insulin  \\\n",
       "count   768.000000  768.000000     768.000000     768.000000  768.000000   \n",
       "mean      3.845052  120.894531      69.105469      20.536458   79.799479   \n",
       "std       3.369578   31.972618      19.355807      15.952218  115.244002   \n",
       "min       0.000000    0.000000       0.000000       0.000000    0.000000   \n",
       "25%       1.000000   99.000000      62.000000       0.000000    0.000000   \n",
       "50%       3.000000  117.000000      72.000000      23.000000   30.500000   \n",
       "75%       6.000000  140.250000      80.000000      32.000000  127.250000   \n",
       "max      17.000000  199.000000     122.000000      99.000000  846.000000   \n",
       "\n",
       "              BMI  DiabetesPedigreeFunction         Age     Outcome  \n",
       "count  768.000000                768.000000  768.000000  768.000000  \n",
       "mean    31.992578                  0.471876   33.240885    0.348958  \n",
       "std      7.884160                  0.331329   11.760232    0.476951  \n",
       "min      0.000000                  0.078000   21.000000    0.000000  \n",
       "25%     27.300000                  0.243750   24.000000    0.000000  \n",
       "50%     32.000000                  0.372500   29.000000    0.000000  \n",
       "75%     36.600000                  0.626250   41.000000    1.000000  \n",
       "max     67.100000                  2.420000   81.000000    1.000000  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAA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ln7X0XCgJB+Btg83FBVDwF3spM126tqDfB/q+rIqjolyc8Avw0cV1WvAU5vXT8DXFBVrwYuBM4Z+pr9GYTTbwBXAGe3Wl6V5MgkBwG/A7ylqo4CNgFnPBe/sNRX538A0jwSumev3Vl7l+OAS6vqXoCqmlq/4PXASW37c8AfDR1zRVVVkpuBe6rqZoAktwBLGUyaeATw9cFVMPZlMOWENGsMCM13twD/fLghyU8ymOH2QZ55lv3CnXxH3zAZ7vNYe39yaHtqfwHwBLChqt7d43ulkfASk+a7jcBPJDkVnlqC9SwGS13eDhyZZK8khzFYfW/K/0uyz9B3vCvJge07Dmjtf81gdlyAU4C/2oW6rgWOTfKK9p0/keSVu/rLSXvCgNC8VoPZKt8BnJzkNuB/AY8yuEvp68D/Bm4GPgncMHToWuCmJBe22W8/BlyT5EbgU63PB4DTktwEvIenxyb61LUd+GXgonb8tcDf293fU9odzuYqSerkGYQkqZMBIUnqZEBIkjoZEJKkTgaEJKmTASFJ6mRASJI6GRCSpE7/H6faJrOoDn8hAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xdbfba58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# y分布，看看各类样本分布是否均衡\n",
    "sns.countplot(train.Outcome);\n",
    "pyplot.xlabel('Outcome');\n",
    "pyplot.ylabel('Number of occurrences');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xdd54470>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAD8CAYAAABthzNFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0c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ar6CXA98NouTVXVJVV1ZFUdQ2+TQqdPhY1NSRYBNPebR1BzZJKsBE4Azqxmg/qI/A1waoflX0Ev/O9r3h9LgLuTvGSYYlW1qflg9zPgr+j2vgCg2bT5VuDqrrXme0BM7aU7mm2ElwDrq+pjI6g3s/VojyQvoPeH6ivD1KqqD1TVkqpaSu//7ItVNfSn4CT7JnnR1sf0dkIOfSRYVT0NPJHksGZoBaO5JPwoPnU9DhydZJ/md7yC3v6loSU5qLl/Gb03fudPhvTeByubxyuBG0dQcySSHAucC5xYVT8cQb1lfZMnMuT7AqCqHqiqg6pqafP+2EDvYJOnh+xtUd/kKXR4X/R5I/CVqtrQuVKXPdzPhRu9bbZfo3c00/kda11FbzXwJ/ReGGd3qPXv6W3uuh+4t7kd36Heq4F7mnrr6Hj0Ql/d19PxKCZ6+wzua24Pdv09NDVfA6xt/r1/BxzQsd4+wD8D/2oEvf0BvT9C64BPA8/vWO9/0QvA+4AVQyz/c69b4MXAGnprI2uAAzvUOqV5/CNgE/CFjr09Qm/f4db3xa4cddRW77rmd3E/8FlgcZd62z3/GIMfxdTW26eBB5rebgIWde0NuAx4Z9fXcVV5JrUkqd1838QkSRqSASFJamVASJJaGRCSpFYGhCSplQEhSWplQEiSWhkQkqRW/x9va75Fz9d3SwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x6accb00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(train.Pregnancies.values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xe0cc828>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxI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XMmWNJC792q6C/gTTx+4DDx/ponHxbcdJ62ZfXZWgj0XpcYmJQkT2PwZl1bVR8DqKrDVfWTqvop8I+M6U/NJ1NVD3fLI8DNXQ2Hj/4J1y2PTLquzoXA7VV1uKtxxftrjoX6aMX3uyRbgNcBb65u0rWb0vhm9/g2BnPVvzipmp7kvVsN/XU88NvADUfbJt1f8+UDE9zH1kKgr5pLDHTzc1cD+6vqfXPa5857/RZw17HPHXNdJyV59tHHDD5Qu4tBP23pNtsC7JpkXXM8btS00v11jIX6aDfwe92RCOcD3zn6Z/MkJHktcDnw+qr6/pz2qQzuRUCS5wNnAw9MsK6F3rvdwCVJnp5kY1fX5yZVV+dVwD1VdfBowyT7a6F8YJL72CQ+/R3Bp8cXMfjE+H7gXStYx68y+JPoi8C+7usi4F+BO7v23cC6Cdf1fAZHGNwB3H20j4DnAnuAA93y1BXosxOBbwI/O6dtRfqLwS+VQ8CPGYyOti7URwz+HP5gt8/dCUxPuK77GMyvHt3Pruq2/Z3uPb4DuB34zQnXteB7B7yr6697gQsnWVfX/iHgD4/ZdpL9tVA+TGwf80xRSWrEWphykST1YKBLUiMMdElqhIEuSY0w0CWpEQa6JDXCQJekRhjoktSI/wOcmbn6grj2CgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xe0db518>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(train.Glucose.values,bins=30,kde=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xe23cc50>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUA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zNj+6KzAXh+kg3AOcBRZmB/VNU3gP86YfVaz/8O4HM18E1gY5KLz0ylJ7daP6rqn6vq2W7xmwy+VwSDftxbVf9TVT8ADjPItImY5aBv4lQLSbYAlwELwEVVdRQGvwyAC6dX2VA+DnwA+E23/CLg6RUv7FnYJy8BloHPdFNQdyQ5lxnbF1X1I+AjwBKDgH8GOMDs7Y/j1nr+Z/l9/+fAP3bXz2g/ZjnohzrVwnqW5AXAF4H3VNXPpl3P6UjyFuBYVR1YuXqVput9n2wALgdur6rLgF+wzqdpVtPNYe8AtgIvBs5lMM1xovW+P05lFl9jJPkggynbu46vWqXZxPoxy0E/1KkW1qskz2EQ8ndV1X3d6qeO/xnaXR6bVn1DeB1wbZIfMpg2u5LBCH9jN3UAs7FPjgBHqmqhW97HIPhnaV8AvBH4QVUtV9WvgfuA1zJ7++O4tZ7/mXvfJ9kJvAW4sf7vePYz2o9ZDvqZPdVCN5d9J3Cwqj664qYHgJ3d9Z3A/We6tmFV1a1VtbmqtjB47r9WVTcCDwFv7Zqt6z4AVNWPgSeSvLRbdRWDU2rPzL7oLAFXJDmne30d78dM7Y8V1nr+HwD+rDv65grgmeNTPOtRBv+E6Wbg2qr65YqbHgCuT/LcJFsZfLj8rxMrpKpm9gd4E4NPsv8D+OC06zmNuv+YwZ9pDwPf6X7exGCOez9wqLs8f9q1DtmfNwBf7q6/pHvBHgb+HnjutOsbov4/Aha7/fEPwHmzuC+AvwK+DzwC/B3w3FnYH8A9DD5X+DWDke6utZ5/BlMen+re899lcJTR1Ptwkn4cZjAXf/x9/rcr2n+w68djwDWTrM1vxkpS42Z56kaSNASDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxv0vyNJjaR4qQlUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xe3cb860>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(train.BloodPressure.values,bins=30,kde=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xe0db940>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAADYdJREFUeJzt3X+MZeVdx/H3R6hoqQaQheBCXWo2WjQpkA2gGIPFH4DGxUQMtJFNQ7L+QSM1TXSrf1T/aIKJtpakkqyALKalpZTKpiFVspIQ/4AyVEKXX7K2CNNd2UFaijaxhX79456N1+0sc3fuXGbnO+9XcnPueeaZe77PPrOfOfeZM2dSVUiS+vqB1S5AkjRbBr0kNWfQS1JzBr0kNWfQS1JzBr0kNWfQS1JzBr0kNWfQS1Jzx692AQCnnnpqbdq0abXLkKQ15dFHH32pqjYs1e+YCPpNmzYxNze32mVI0pqS5N8n6efSjSQ1Z9BLUnMGvSQ1Z9BLUnMGvSQ1Z9BLUnMGvSQ1Z9BLUnMGvSQ1d0z8Zuw0PvXw8xP3fc+Fb59hJZJ0bPKMXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqTmDXpKaM+glqbklgz7JWUkeSPJUkieS3DC0n5Lk/iTPDtuTh/YkuSnJviSPJzl/1oOQJB3ZJGf0rwEfrKp3AhcB1yc5B9gB7KmqzcCeYR/gcmDz8NgO3LziVUuSJrZk0FfVgar68vD8VeApYCOwFdg1dNsFXDk83wrcUSMPASclOWPFK5ckTeSo1uiTbALOAx4GTq+qAzD6Z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QFV9p6q+yTqYa0YXhvxwkuOBtwIHaDjXVfUg8PJhzUea363AHTXyEHBSkjOWc9y1HPSL3WZh4yrV8qZIsgk4D3gYOL2qDsDomwFw2upVNjN/Bfwh8L1h/8eAb1bVa8N+tzl/B7AA/O2wXHVLkhNpPtdV9XXgL4DnGQX8K8Cj9J7rcUea3xXLuLUc9EveZqGTJG8DPgd8oKq+tdr1zFqS3wAOVtWj482LdO0058cD5wM3V9V5wH/TbJlmMcOa9FbgbODHgRMZLVscrtNcT2LFvt7XctAveZuFLpK8hVHIf7Kq7hmaXzz0Nm7YHlyt+mbkYuA3kzzHaFnu3YzO8E8a3t5DvzmfB+ar6uFh/25Gwd99rn8Z+FpVLVTVd4F7gJ+n91yPO9L8rljGreWgXxe3WRjWpW8Fnqqqj459aDewbXi+Dbj3za5tlqrqQ1V1ZlVtYjS3/1RV7wUeAH576NZq3FX1H8ALSX5qaLoUeJLmc81oyeaiJG8dvt4PjbvtXB/mSPO7G7h2uPrmIuCVQ0s8R62q1uwDuAL4V+DfgD9Z7XpmNMZfYPR27XHgseFxBaP16j3As8P2lNWudYb/BpcAXxievwP4ErAP+CxwwmrXt8JjPReYG+b774GT18NcA38GPA3sBf4OOKHjXAN3Mvo5xHcZnbFfd6T5ZbR084kh377C6KqkZR3X34yVpObW8tKNJGkCBr0kNWfQS1JzBr0kNWfQS1JzBr0kNWfQS1JzBr0kNfe/iRohHAIeT+kAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xdcc67b8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(train.SkinThickness.values,bins=30,kde=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xe64fc50>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBOR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itwgcfPT/vmQ8C3gUeBPwHOX4vHj3fGSlLn1vLQjSRpBAa9JHXOoJekzhn0ktQ5g16SOmfQS1LnDHpJ6pxBL0md+7/5Itbm8rEuoAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xed8e9b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(train.Insulin.values,bins=30,kde=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xed6e9e8>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD8CAYAAACW/ATfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAADl5JREFUeJzt3WusHPV9xvHvUxyaQJqaywG5GNcgWQRUlUuPuJQqSiGtgEbAC5C4qLUiS35DW2giJdBKRX0XpCqQShWSBSSuxC0lpCCEkiIHVLVSndpAwsWhdgk1Lg52WghtIrWh+fXFjtUjc5yz3tnj3eX//UhHu/M/szsPR8PD8N+Z2VQVkqT3t5+bdABJ0vKz7CWpAZa9JDXAspekBlj2ktQAy16SGmDZS1IDLHtJaoBlL0kNWDHpAAAnnnhirV27dtIxJGmmbN++/QdVNTfMulNR9mvXrmXbtm2TjiFJMyXJvw67rtM4ktQAy16SGmDZS1IDLHtJaoBlL0kNWLLsk9yXZF+SFxeMHZ/kqSQ7u8fjuvEk+Ysku5J8J8l5yxlekjScYY7svwxcdtDYrcCWqloHbOmWAS4H1nU/G4G7xxNTktTHkmVfVX8H/MdBw1cBm7vnm4GrF4z/VQ38I7AyyapxhZU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K/BsMpg2+Azzf/VwxA7l/FXiuy/0i8Kfd+OnAt4BdDP43+OcnnfUQ+T8OPDELmbt83+5+Xjrw798M7CPnANu6feRvgONmIPMxwL8Dv7hg7LAzewWtJDVglqdxJElDsuwlqQGWvSQ1wLKXpAZY9pLUAMtekhpg2UtSAyx7SWrA/wENuAjJ6sL1YgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xee7ea20>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(train.BMI.values,bins=30,kde=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xf0adb38>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAD9ZJREFUeJzt3X2MXFd9xvHv07zQAm0d8Ia6toNDZdECApGuQigSikhRA0VxpAbJJAJDU1ktaYHSCgJIpKqEBGrFW1+CDEkxVQiJAm1cFNqmISiq1LhsQt4NxA2ts8TghUCAUgFuf/1jr2Exa8/s3BmP9/j7kVY799wzM789un589uy9d1JVSJLa9VPTLkCSNFkGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxJ0+7AIC1a9fWpk2bpl2GJK0qd9xxx9eqamZQv+Mi6Ddt2sTc3Ny0y5CkVSXJfw3Tz6UbSWqcQS9JjTPoJalxBr0kNc6gl6TGGfSS1DiDXpIaZ9BLUuMMeklq3HFxZezx5qO79w3V7+LnnTHhSiSpP2f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hMVgHnNU9/lngi8v8W2j6WBhyDFZ8LEx7Rv/DWyVU1feBQ7dKWGoLsLN7fANwXpLlLsharYYZg6ZV1W3Ao0fpsgX4SC26HViTZN2xqe7YGGIMmldV+6vqzu7xt4E9/OQV9U0fC0OOwYpNO+iHuVXCD/tU1UHgMeDJx6S6Y2PY20X8Vver6g1JNi6zv2XeUmPR85PcneRTSZ457WImqVuifS6w+7BdJ8yxcJQxgBUeC9MO+oG3Shiyz2o2zM/3D8Cmqno28C/86DecE0Xrx8Aw7gSeWlXPAf4C+Psp1zMxSZ4IfBx4Q1V96/DdyzyluWNhwBis+FiYdtAPvFXC0j5JTgZ+nrZ+xR3mdhFfr6rvdZsfBH71GNV2vBjmOGlaVX2rqr7TPb4JOCXJ2imXNXZJTmEx4K6pqk8s06X5Y2HQGIxyLEw76Ie5VcIuYFv3+CLg09X9RaIRA8fgsDXIC1hctzuR7AJe1Z1xcQ7wWFXtn3ZRx1KSXzj0t6kkZ7P4b/fr061qvLqf7ypgT1W9+wjdmj4WhhmDUY6FqX44eB3hVglJ/hSYq6pdLP7Qf5tkL4sz+a3Tq3j8hhyD1yW5ADjI4hi8emoFT0CSa1k8k2BtknngCuAUgKr6AItXWL8U2At8F3jNdCqdnCHG4CLg95IcBP4H2NrYhAfgBcArgXuT3NW1vRU4A06YY2GYMVjxseCVsZLUuGkv3UiSJsygl6TGGfSS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcf8PXXQ9W7qIvv0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xf2766a0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(train.DiabetesPedigreeFunction.values,bins=30,kde=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xf3b63c8>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAEMpJREFUeJzt3X+s3XV9x/HnSyoqqCnQC6stXcvSoMwosBtAWYwDf4AjlD8kA9lsHEuzjM3fUdA/iEtMNDOiZhtJB2hNAGWIgRCmkopxW0ZdCyg/KqMDViqVXqPgposT994f59t5rZfee8/3XO49H56P5Oac7+d8zjnvD/ec1/3w+f5oqgpJUruet9gFSJIWlkEvSY0z6CWpcQa9JDXOoJekxhn0ktQ4g16SGmfQS1LjZg36JNck2Zfkvhkee3+SSrKi206SzyTZleQ7SU5eiKIlSXO3bA59Pgf8NfD56Y1JjgXeCOye1nw2sL77ORW4srs9qBUrVtTatWvnVLAkaWDHjh0/qKqJ2frNGvRV9c0ka2d46ArgA8DN09o2AJ+vwXUV7kyyPMnKqtp7sPdYu3Yt27dvn60USdI0Sf5jLv2GWqNPci7wvar69gEPrQIem7a9p2uTJC2SuSzd/IokhwEfBt4008MztM141bQkm4BNAGvWrJlvGZKkORpmRv9bwDrg20keBVYDdyX5DQYz+GOn9V0NPD7Ti1TV5qqarKrJiYlZl5gkSUOad9BX1b1VdXRVra2qtQzC/eSq+j5wC/D27uib04CnZluflyQtrLkcXnk98C/A8Un2JLn4IN1vAx4GdgF/B/zZSKqUJA1tLkfdXDjL42un3S/gkv5lSZJGxTNjJalxBr0kNc6gl6TGzfs4+qXmum27Z+/UedupHq8v6bnHGb0kNc6gl6TGGfSS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxhn0ktQ4g16SGmfQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMbNGvRJrkmyL8l909r+Ksl3k3w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gEnA1dW1UnATxiD5Y1n0q1bnwv8/WLXMqxuP8IGYB3wMuBwBp+zAz0r35UlHfRJns8g5K+tqpu65ieSrOweX8lghjw2qupJ4BsM9jssT7L/XIZfu0zEEnQ6cG6SR4EvMFi++RTjNw4Aqurx7nYfg7XgUxjPz9ceYE9Vbeu2b2QQ/OM4FhgE4l1V9US3PY7jeAPwSFVNVdXPgZuA17JI35UlG/RJAlwN7KyqT0576BZgY3d/I4O1+yUtyUSS5d39FzH4EOwE7gDe2nVb8mOpqsuqanVVrWXwv9Zfr6qLGLNxACQ5PMlL9t9nsCZ8H2P4+aqq7wOPJTm+azqTwSXBx24snQv55bINjOc4dgOnJTmsy7L9v5NF+a4s2ROmkvwu8I/AvfxyPfhDDNbpbwDWMPiPeX5V/XBRipyjJK8CtjDY8/484Iaq+sskxzGYGR8J3A38YVX9bPEqnbskrwfeX1XnjOM4upq/3G0uA66rqo8mOYox+3wBJDkRuAo4FHgYeAfdZ40xGkuSwxjsxDyuqp7q2sb1d/IR4A8YHEF4N/AnDNbkn/XvypINeknSaCzZpRtJ0mgY9JLUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxBr0kNe7/AEABeUxdOQH4AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xf4ea710>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.distplot(train.Age.values,bins=30,kde=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Glucose BloodPressure BMI有少量为0的数据点，需要填补\n",
    "\n",
    "SkinThickness Insulin为0的数据较多：\n",
    "\n",
    "其中SkinThickness，认为其值不可能为0，尝试用均值和中值填补\n",
    "\n",
    "Insulin需要进一步确定"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "missingColunm = ['Glucose','BloodPressure','BMI']\n",
    "from sklearn.preprocessing import Imputer \n",
    "imp = Imputer(missing_values=0, strategy='median', axis=0, copy=True)\n",
    "train[missingColunm] = imp.fit_transform(train[missingColunm])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\dev\\ai\\anaconda2\\lib\\site-packages\\ipykernel_launcher.py:2: FutureWarning: reshape is deprecated and will raise in a subsequent release. Please use .values.reshape(...) instead\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xf75c240>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAADrxJREFUeJzt3G+MXNV9xvHvU5ykKkkF1AtybFOTyG1DKsWgFSGlL2hpG4KiOpFKC6GJhaicF0SFiqqCvEn6AimV8l9tUZ1AQ6QEghJSLISSUhcpzYs4rBMEBgfFChQ2du2lpEAbCdXk1xdzLabO2DO7s7Njn/1+pNHMPXPuzG+vzz5zfPbeSVUhSWrXL0y7AEnSZBn0ktQ4g16SGmfQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMatmXYBAGvXrq1NmzZNuwxJOqXs2bPnuaqaGdbvpAj6TZs2MTc3N+0yJOmUkuTfR+nn0o0kNc6gl6TGGfSS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcQa9JDXupLgyVsvjy7ufGdj+vrefu8KVSDqZOKOXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjRsa9Ek2Jnkoyb4kjye5oWv/aJIfJ3mku13Rt88tSfYneTLJOyf5A0iSTmyU8+iPADdV1feSvAHYk+TB7r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s28uBl44usSzWF4wNSFJfhv4N+AxXl2b/jC9dfp7gHPpDforq+r5qRS5wpJcCvxlVb07yZvozfDPAr4P/GlVvTzN+iYtyRbg88BrgR8B19KbbK2q8ZDkr4E/oXdm2veBP6O39tz8eEhyF3ApvW+pPAR8BPgnBoyB7oPwb+mdpfNT4NqqmlvS+xr0ktQ2l24kqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9Jjfs/GbzK2g6biTUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xdc64dd8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "imp = Imputer(missing_values=0, strategy='median', axis=0, copy=True)\n",
    "transformSkinThickness_median = imp.fit_transform(train['SkinThickness'].reshape(-1, 1))\n",
    "sns.distplot(transformSkinThickness_median,bins=50,kde=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\dev\\ai\\anaconda2\\lib\\site-packages\\ipykernel_launcher.py:2: FutureWarning: reshape is deprecated and will raise in a subsequent release. Please use .values.reshape(...) instead\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xf7c3f60>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAADrlJREFUeJzt3F2MXOV9x/HvrzhJVZIKXC/IsU1NIrcNqRSDVkBKL2hpy4uimkilNaGJhaicC6JClaoi3CS9QEqlvKstqgMUIvESK5B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F/Kxb/hXgv6rqaLc8Sy8AWvYWYA74x24K664kZ7LCxkNV/QD4GPACcAh4GdjLyhsP/U40Bub7KplF7ReDfsySvBF4GLi1ql6ZdD3LLcm7gCNVtbe/eZ6urZ/+tQq4CLizqi4E/ofGp2nm080/bwHOB94MnElviuJ4rY+HYSzZ34lBP0ZJXkcv5O+vqke65sNJ1nbPrwWOTKq+ZXIZ8IdJngceojd98yngrCTHruP4ua/IaNAsMFtVe7rlL9AL/pU2Hn4PeK6q5qrqf4FHgN9i5Y2HficaAwO/SmZYBv2YJAlwN7C/qj7R99QuYFv3eBu9uftmVdWHqmp9VW2k96Hbv1bVDcATwB913VbCfvgP4MUkv941XUHva7tX1HigN2VzaZJf6v5Gju2HFTUejnOiMbALeF939s2lwMvHpngWygumxiTJbwP/Bnyb1+amb6c3T78TOI/eoL+uqn44kSKXWZLLgb+sqncleQu9I/zVwLeAP62qn06yvnFLshm4C3g98H3gRnoHWytqPCT5a+BP6J2Z9i3gz+jNPTc/HpI8CFxO71sqDwMfBv6JecZA90b4t/TO0vkJcGNVzSxquwa9JLXNqRtJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4/4PHIjLi2idiBgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xdc64eb8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "imp = Imputer(missing_values=0, strategy='mean', axis=0, copy=True)\n",
    "transformSkinThickness_mean = imp.fit_transform(train['SkinThickness'].reshape(-1, 1))\n",
    "sns.distplot(transformSkinThickness_mean,bins=50,kde=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "先用均值填补的数据进行训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "#train['SkinThickness']=transformSkinThickness_mean\n",
    "y_train = train['Outcome']\n",
    "train = train.drop([\"Outcome\"], axis=1)\n",
    "X_train = np.array(train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据标准化\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "# 初始化特征的标准化器\n",
    "ss_X = StandardScaler()\n",
    "\n",
    "# 分别对训练和测试数据的特征进行标准化处理\n",
    "X_train = ss_X.fit_transform(X_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 训练、测试集分割"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\dev\\ai\\anaconda2\\lib\\site-packages\\sklearn\\model_selection\\_split.py:2026: FutureWarning: From version 0.21, test_size will always complement train_size unless both are specified.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train_part, X_val, y_train_part, y_val = train_test_split(X_train, y_train, train_size = 0.8,random_state = 0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Logistic回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'penalty': ['l1', 'l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='average_precision', verbose=0)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "penaltys = ['l1','l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lr_penalty= LogisticRegression()\n",
    "grid_lr= GridSearchCV(lr_penalty, tuned_parameters,cv=5, scoring='average_precision')\n",
    "grid_lr.fit(X_train_part,y_train_part)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7310656842965694\n",
      "{'penalty': 'l1', 'C': 0.1}\n"
     ]
    }
   ],
   "source": [
    "print(grid_lr.best_score_)\n",
    "print(grid_lr.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "测试集分数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7237586073796048\n"
     ]
    }
   ],
   "source": [
    "print(grid_lr.score(X_val,y_val))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# SVM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import LinearSVC\n",
    "from sklearn.metrics import accuracy_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LinearSVC(C=1.0, class_weight=None, dual=True, fit_intercept=True,\n",
       "     intercept_scaling=1, loss='squared_hinge', max_iter=1000,\n",
       "     multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,\n",
       "     verbose=0),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'C': array([1.e-03, 1.e-02, 1.e-01, 1.e+00, 1.e+01, 1.e+02, 1.e+03])},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='average_precision', verbose=0)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-3, 3, 7)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份  \n",
    "tuned_parameters = dict( C = C_s)\n",
    "\n",
    "SVC =  LinearSVC()\n",
    "\n",
    "grid_svm = GridSearchCV(SVC, tuned_parameters,cv=5, scoring='average_precision')\n",
    "grid_svm.fit(X_train_part,y_train_part)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7304985516473951\n",
      "{'C': 1.0}\n"
     ]
    }
   ],
   "source": [
    "print(grid_svm.best_score_)\n",
    "print(grid_svm.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "测试集分数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7263274787753153\n"
     ]
    }
   ],
   "source": [
    "print(grid_svm.score(X_val,y_val))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 作ROC图比较两者性能"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x100ddf98>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgA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7TWKXSzI10XNwB/14Y0wFMp5d9fr2/Nyb27jbkDejpHa90KdGzMbavMueeu7sP4z2/L+rxnpdR0IEhr/dlgBjaAzPk5RwKRSqkdSqk0pdSKQe1v5z4AAAHXSURBVItuYJhzz88AdymlijD2j3h4cEKzmCv9e78iZm3WYSH9tjG3DTH7fpRSdwFxwKIBjWjg9XrPSikH4I/AtwcroEFgzs95GEbXzGKMd2epSqnJWuvKAY5toJhzz+uAN7XWzyul5mDs7jZZa20a+PAsYkDzlzW33PttY24bYs49o5RaDjwJrNFaNw1SbAOlr3t2AyYDW5VSJzD6JjfY+KCqub/bn2qtW7TWBUAORrK3Vebc833ABwBa612AE0YNFntl1t/71bLm5D4UN+bu857buyhex0jstt4PC33cs9a6SmvtrbUO1loHY4wzrNFaZ1gm3H5hzu/2JxiD5yilvDG6afIHNcr+Zc49nwKWASilojCSe9mgRjm4NgB3t8+aSQCqtNZn+u3qlh5R7mO0+XrgGMYo+5Ptzz2L8ccNxg//QyAP2AOEWjrmQbjnTUAJcKD9Y4OlYx7oe77k3K3Y+GwZM3/OCngByAIOA2stHfMg3HM0sANjJs0BIMnSMV/j/b4HnAFaMFrp9wHfB77f5Wf8Svv343B//17LClUhhLBD1twtI4QQ4ipJchdCCDskyV0IIeyQJHchhLBDktyFEMIOSXIXQgg7JMldCCHskCR3IYSwQ/8fWZaJ9r6tUy4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xfe97048>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.metrics import roc_curve, auc   \n",
    "from scipy import interp  \n",
    "\n",
    "y_predict_lr = grid_lr.predict(X_val)\n",
    "y_predict_svc = grid_svm.predict(X_val)\n",
    "\n",
    "mean_tpr = 0.0    \n",
    "mean_fpr = np.linspace(0, 1, 100)    \n",
    "all_tpr = []  \n",
    "    \n",
    "fpr, tpr, thresholds = roc_curve(y_val, y_predict_lr)  \n",
    "mean_tpr += interp(mean_fpr, fpr, tpr)          #对mean_tpr在mean_fpr处进行插值，通过scipy包调用interp()函数  \n",
    "mean_tpr[0] = 0.0                               #初始处为0  \n",
    "roc_auc = auc(fpr, tpr)  \n",
    "#画图，只需要plt.plot(fpr,tpr),变量roc_auc只是记录auc的值，通过auc()函数能计算出来  \n",
    "plt.plot(fpr, tpr, lw=1, label='ROC of LR  (area = %0.2f)' % roc_auc)  \n",
    "  \n",
    "fpr, tpr, thresholds = roc_curve(y_val, y_predict_svc)  \n",
    "mean_tpr += interp(mean_fpr, fpr, tpr)          #对mean_tpr在mean_fpr处进行插值，通过scipy包调用interp()函数  \n",
    "mean_tpr[0] = 0.0                               #初始处为0  \n",
    "roc_auc = auc(fpr, tpr)  \n",
    "#画图，只需要plt.plot(fpr,tpr),变量roc_auc只是记录auc的值，通过auc()函数能计算出来  \n",
    "plt.plot(fpr, tpr, lw=1, label='ROC of SVM  (area = %0.2f)' % roc_auc)  \n",
    "    \n",
    "#画对角线  \n",
    "plt.plot([0, 1], [0, 1], '--', color=(0.6, 0.6, 0.6))  \n",
    "pyplot.legend()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过ROC曲线图以及AUC值可以看出，SVM性能略优于logistic"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# RBF核的SVM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import SVC"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma='auto', kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'C': array([1.e-04, 1.e-03, 1.e-02, 1.e-01, 1.e+00, 1.e+01, 1.e+02, 1.e+03,\n",
       "       1.e+04]), 'gamma': array([1.e-03, 1.e-02, 1.e-01, 1.e+00, 1.e+01, 1.e+02, 1.e+03])},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='average_precision', verbose=0)"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-4, 4, 9)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份 \n",
    "gamma_s = np.logspace(-3, 3, 7)  \n",
    "\n",
    "SVC_RBF =  SVC(kernel='rbf')\n",
    "\n",
    "tuned_parameters = dict(gamma = gamma_s, C = C_s)\n",
    "\n",
    "grid_svm = GridSearchCV(SVC_RBF, tuned_parameters,cv=5, scoring='average_precision')\n",
    "grid_svm.fit(X_train_part,y_train_part)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7345788723615936\n",
      "{'C': 0.001, 'gamma': 0.1}\n"
     ]
    }
   ],
   "source": [
    "print(grid_svm.best_score_)\n",
    "print(grid_svm.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "测试集分数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7206943800414859\n"
     ]
    }
   ],
   "source": [
    "print(grid_svm.score(X_val,y_val))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
